﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using JLL.China.Infrastructure.Services;
using JLL.China.Model;
using JLL.China.Model.DTO;
using JLL.China.Web.Areas.Listings.Models;
using JLL.China.Web.Libraries;
using JLL.China.Application;
namespace JLL.China.Web.Models
{
    public class HomeModel : ListingModel
    {
        public IList<Model.Listings> PostpropertyPending;
        public IList<Model.Listings> PostpropertyRejected;
        public int currentPageIndexPending { get;set;}
        public int pageSizePending { get; set; }
        public int currentPageIndexReject { get; set; }
        public int pageSizeReject { get; set; }
        public HomeModel()
        {
            PostpropertyPending = this.GetPostByStatus(4);
            PostpropertyRejected = this.GetPostByStatus(5);
        }

        public IPagedList<Model.Listings> PropertyPending()
        {
            return PostpropertyPending.ToPagedList(currentPageIndexPending, pageSizePending);
        }
        public IPagedList<Model.Listings> PropertyReject()
        {
            return PostpropertyRejected.ToPagedList(currentPageIndexReject, pageSizeReject);
        }

        public void CheckLogin()
        {
            var loginAcc = HttpContext.Current.Session[Constants.Session_User] as Model.Admin;
            if(loginAcc == null){

                HttpContext.Current.Response.Write("<script>alert('alert');</script>");
            }
        }
    }
}
